package com.woniu.adminservice.dao;

import com.woniu.adminservice.entity.RolesMenus;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RolesMenusDao {
    RolesMenus queryById(Integer id);

    List<RolesMenus> queryAllByLimit(@Param("offset") int offset, @Param("limit") int limit);
    
    List<RolesMenus> findAll();

    List<RolesMenus> queryAll(RolesMenus rolesMenus);

    int insert(RolesMenus rolesMenus);

    int update(RolesMenus rolesMenus);

    int deleteById(Integer id);

    void saveRolesMenus(List<RolesMenus> list);

    @Select("select * from roles_menus where  role_id = #{value}")
    List<RolesMenus> selectByRoleId(Integer id);

    @Delete("delete from roles_menus where role_id = #{value}")
    void deleteByRoleId(Integer id);

    List<RolesMenus> selectByRoleIds(List roleIds);

    void deleteByIds(List roleIds);
}